package com.uoko.plugins.es.common;


import com.alibaba.fastjson.JSONObject;
import org.elasticsearch.action.search.SearchRequest;

import java.util.List;

/**
 * <p>搜索相关接口</p>
 *
 * @author shaohua
 * @date on 2018/5/25.
 * Email:xiaomabenten@gmail.com
 */
public interface SearchClient {

    /**
     * 搜索结果
     *
     * @param request
     * @return
     */
    List<JSONObject> search(SearchRequest request);

    /**
     * 搜索(对象)
     *
     * @param request
     * @param tClass
     * @param <T>
     * @return
     */
    <T> List<T> search(SearchRequest request, Class<T> tClass);


}
